<%@page contentType="text/html; charset=UTF-8" language="java" %>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*" %>
<%@page import="com.mew.util.*" %>
<%@page import="com.humyu.school.corebase.*" %>
<% request.setCharacterEncoding("UTF-8");%>
<html>
<head>
<script language="JavaScript">
function getGrades(){
	var SchoolID;
	SchoolID = document.form1.SchoolID.value;
	location.href=<%=com.humyu.servlet.DispatcherServlet.PREFIX%>+"do?action=DOCLASSADD&SchoolID="+SchoolID;
}
</script>
<title></title>
<link href="css/common.css" rel="stylesheet" type="text/css">
</head>
<body>
<form name="form1" method="post" action="<%=com.humyu.servlet.DispatcherServlet.PREFIX%>do" target="mainFrame" onSubmit="return CheckValid()">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center"><p><strong>班级信息添加</strong></p>
        <table width="75%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#BBD1FC">
          <!--<tr>
            <td width="48%" align="right"><strong>学校：</strong></td>
            <td width="52%" align="left">
              <select name="SchoolID" id="SchoolID" onChange="getGrades()">
                <option value="-1" selected>请选择学校</option>
                <%
			//Iterator iteratorSchool = null;
			Iterator iteratorGrade = null;
			/*iteratorSchool = (Iterator)request.getAttribute("schools");
			String SchoolID = (String)request.getAttribute("SchoolID");
			while(iteratorSchool.hasNext()){
				School school = (School)iteratorSchool.next();
				if(school.getSchoolID().equals(SchoolID)){
					out.println("<option value='"+school.getSchoolID()+"' selected>"+school.getSchoolName()+"</option>");
				}else{
					out.println("<option value='"+school.getSchoolID()+"'>"+school.getSchoolName()+"</option>");
				}
			}**/
		%>
              </select>
            </td>
          </tr>-->
          <tr>
            <td align="right"><strong>年级：</strong></td>
            <td align="left"> <select name="SchoolGradeID" id="SchoolGradeID">
                <option value="-1" selected>请选择年级</option>
                <%
			iteratorGrade = (Iterator)request.getAttribute("grades");
			String SchoolGradeID = (String)request.getAttribute("SchoolGradeID");
			if(iteratorGrade!=null){
				while(iteratorGrade.hasNext()){
					Grade grade = (Grade)iteratorGrade.next();
					if(SchoolGradeID.equals(String.valueOf(grade.getSchoolGradeID()))){
						out.println("<option value='"+grade.getSchoolGradeID()+"' selected>"+grade.getSchoolGradeName()+"</option>");
					}else{
						out.println("<option value='"+grade.getSchoolGradeID()+"'>"+grade.getSchoolGradeName()+"</option>");
					}
				}
			}
		%>
              </select>
			  <%
			  String SchoolID = (String)request.getAttribute("SchoolID");
			  %>
              <input name="SchoolID" type="hidden" id="SchoolID" value="<%=SchoolID%>"></td>
          </tr>
          <tr>
            <td align="right"><strong>班级名称：</strong></td>
            <td align="left"><input name="SchoolClassName" type="text" id="SchoolClassName2"></td>
          </tr>
        </table>
        <p>
          <input name="action" type="hidden" value="CLASSADD">
          <input type="submit" name="Submit" value="添　加">
          &nbsp;&nbsp;&nbsp;&nbsp;
          <input type="reset" name="Submit2" value="返　回" onClick="history.back()">
        </p></td>
    </tr>
  </table>
</form>
</body>
</html>
